import requests
import re
import baozou_insert_sql
Platform = "奇热"
def qire():
    r = requests.session()
    url="https://ad.qirexiaoshuo.com/index/login.html"
    data = {
        "username": "",
        "passwore": ""
    }
    rr = r.post(url=url,data=data)
    aa = r.get(url="https://ad.qirexiaoshuo.com/tongji/index")
    html = aa.text
    ht = html.replace('\r','').replace('\t','').replace('\n','')
    date_time_list = re.findall('<tr>.*?<td>(.*?)</td>',ht)
    Amount_share_list = re.findall('<td class="orange">(.*?)</td>',ht)
    date_time = date_time_list[1]
    Amount_share = Amount_share_list[1]
    # 数据入库
    try:
        baozou_insert_sql.baozou_spider_everyday_sum(date_time, Amount_share, Platform)
    except  Exception:
        print("数据入库失败")
    # print(date_time,Amount_share)
